charge a capacitor